fix(i18n,billing): Phase 1 audit fixes — DE BGB-waiver translation + …#24
Merged
Conversation
…§356 pin tests Addresses 4 findings from the post-audit 4-eyes review (HIGH H1, H2 + MEDIUM M5, M8). Stacked onto PR-i18n-2c so the legally load-bearing checkbox label ships with the rest of the BGB-waiver feature. H1: BGB-waiver checkbox in pricing.html had an empty msgstr in de.po — DE-locale customers saw the §356 (5) BGB consent text only in English. Added the German translation and re-compiled the .mo so /de/pricing now renders "Ich verzichte auf mein 14-tägiges Widerrufsrecht und stimme der sofortigen Vertragsausführung gemäß § 356 Abs. 5 BGB zu." H2: test_pricing_renders_live_buttons_with_waiver_gate_when_stripe_enabled pinned the structural HTML anchors (`id="pro-waiver"`, `data-target=`) but not the legal text. A copy-edit could have dropped "§356" or "14-day" without breaking any test. Added two assertions that fail loudly if either is removed. M5: locale/messages.pot and both .po files carried "Project-Id-Version: FileMorph VERSION" with the Babel placeholder. scripts/i18n.py now reads the version from pyproject.toml and passes --version=1.0.0 to pybabel extract; the same value is used by drift-check so headers stay deterministic. M8: The waiver-gate test set templates.env.globals["stripe_enabled"] = True without restoring it. Jinja globals are session-shared across pytest, so later tests that hit /pricing in Coming-Soon mode could read the leaked True. Wrapped the assertion block in try/finally that restores the original value (or pops it if unset). Verification: - pytest tests/ -q: 473 passed, 15 skipped - ruff check . + ruff format --check .: clean - python scripts/i18n.py drift-check: exit 0 - de.po: 401/401 (100%) translated Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…§356 pin tests
Addresses 4 findings from the post-audit 4-eyes review (HIGH H1, H2 + MEDIUM M5, M8). Stacked onto PR-i18n-2c so the legally load-bearing checkbox label ships with the rest of the BGB-waiver feature.
H1: BGB-waiver checkbox in pricing.html had an empty msgstr in de.po — DE-locale customers saw the §356 (5) BGB consent text only in English. Added the German translation and re-compiled the .mo so /de/pricing now renders "Ich verzichte auf mein 14-tägiges Widerrufsrecht und stimme der sofortigen Vertragsausführung gemäß § 356 Abs. 5 BGB zu."
H2: test_pricing_renders_live_buttons_with_waiver_gate_when_stripe_enabled pinned the structural HTML anchors (
id="pro-waiver",data-target=) but not the legal text. A copy-edit could have dropped "§356" or "14-day" without breaking any test. Added two assertions that fail loudly if either is removed.M5: locale/messages.pot and both .po files carried "Project-Id-Version: FileMorph VERSION" with the Babel placeholder. scripts/i18n.py now reads the version from pyproject.toml and passes --version=1.0.0 to pybabel extract; the same value is used by drift-check so headers stay deterministic.
M8: The waiver-gate test set templates.env.globals["stripe_enabled"] = True without restoring it. Jinja globals are session-shared across pytest, so later tests that hit /pricing in Coming-Soon mode could read the leaked True. Wrapped the assertion block in try/finally that restores the original value (or pops it if unset).
Verification: